package com.system.manager.modules.authorized.enums;

import com.system.manager.common.enums.IErrorCode;

/**
 * 授权错误码
 * @author meteor
 */
public enum AuthorizationErrorCode implements IErrorCode {

    /**
     * 没有携带Authorization请求头
     */
    NON_HEADER_AUTHORIZATION(1000, "未找到认证信息"),

    /**
     * Authorization请求头不合法
     */
    ILLEGAL_HEADER_AUTHORIZATION(1001, "非法的认证信息"),

    REQUEST_PATH_ERROR(1011,"请求路径错误"),

    /**
     * token验证失败
     */
    SIGN_VERIFY_FAILURE(1003, "登陆过期"),

    /**
     * token验证失败
     */
    API_ERROR(1004, "接口访问异常"),

    ACCOUNT_EXISTS(1007, "用户已存在"),

    USER_NOT_EXISTS(1006, "用户名或密码不正确"),

    DATA_NOT_SAME(1008, "数据不一致"),

    PSWD_ERROR(1009, "原密码不正确"),

    PSWD_NOT_SAME(1010, "密码不一致"),

    IDENTITY_INFORMATION(1005, "身份信息不符");


    private Integer code;
    private String msg;

    AuthorizationErrorCode(Integer code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    @Override
    public Integer getCode() {
        return code;
    }

    @Override
    public String getMsg() {
        return msg;
    }
}
